<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<div style="width:600px;height:300px;border:2px solid blue;margin:0px auto;">

<div style="width:600px;height:50px;background-color:cyan;text-align:center;line-height:50px;">
全国考试登录系统
</div>

<div style="weidth:300px;height:200px;margin:0 auto;border:1px solid red;">

<!-- 将内容提交到显示页面 -->
<form action="show.jsp" method="post"  name="form1" onSubmit="return Test(form1)">

<input type="text" name="userName">
<input type="submit" value="登录">

</form>

</div>

</div>

<script type="text/javascript">

/* 判断表单提交的内容是否为空 */
function Test(form){
	for(var i=0 ; i<form.length;i++){
		if(form.elements[i].value==""){
			alert("用户不能为空!");
			return false;
		}
	}
}



</script>

</body>
</html>